<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
 <c:choose>
    <c:when test="${requestScope.title != null }">
        <h2>${requestScope.title }</h2>
        <h3>검색조건 : ${requestScope.search_value }</h3>
    </c:when>
    <c:otherwise>
        <h2>회원목록</h2>
    </c:otherwise>
 </c:choose>
    <c:if test='${fn:length(requestScope.member_list) == 0 }'>
      <b><i>조회 결과</i></b><p>
    </c:if>
    <c:if test='${fn:length(requestScope.driver_list) == 0 }'>
        <b><i>조회 결과</i></b><p>
    </c:if>
<table width="1000" border='1' cellspacing="0">
    <thead>
        <tr>
            <td>ID</td>
            <td>Password</td>
            <td>전화번호</td>
            <td>이름</td>
            <td>e-mail</td>
            <td>주소</td>
            <td>회원구분</td>
            <td>가입일</td>
            <td>차량번호</td>
            <td>운전면허번호</td>
            <td>운전자사진등록</td>
            <td>차량상태</td>
            <td>택시구분</td>
        </tr>
    </thead>
    <tbody>
        <c:set var="j" scope="request" value="0"/>
        <c:forEach begin="0" end="${fn:length(requestScope.member_list) - 1}" step="1" var="i">
            <tr>
                <td>${requestScope.member_list[i].memberId}</td>
                <td>${requestScope.member_list[i].password}</td>
                <td>${requestScope.member_list[i].phone}</td>
                <td>${requestScope.member_list[i].name}</td>
                <td>${requestScope.member_list[i].email}</td>
                <td>${requestScope.member_list[i].address}</td>
                <td>${requestScope.member_list[i].memberType}</td>
                <td>${requestScope.member_list[i].joinDate}</td>
                <c:choose>
                    <c:when test="${requestScope.member_list[i].memberType == 2}">
                        <td>${requestScope.driver_list[requestScope.j].carRegNum}</td>
		                <td>${requestScope.driver_list[requestScope.j].dlLicenseNum}</td>
		                <td>${requestScope.driver_list[requestScope.j].picLoc}</td>
		                <td>${requestScope.driver_list[requestScope.j].status}</td>
		                <td>${requestScope.driver_list[requestScope.j].taxiType}</td>
		                <c:set var="j" scope="request" value="${requestScope.j +1}"/>
                    </c:when>
                    <c:otherwise>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </c:otherwise>
                </c:choose>
            </tr> 
        </c:forEach>
    </tbody>
</table>
<p>
<a href="/kosta_project_final_taxi/index.jsp">메인 페이지</a>
<a href="/kosta_project_final_taxi/member/search_form.jsp">검색</a>
</p>
</body>
</html>